myNum = int(input("请输入一个整数:"))
step = 0
f1 = 1
f2 = 1000
while f1<=f2:
    mid = (f1+f2)//2
    step += 1
    if mid>myNum:
        f2 = mid -1
    elif mid<myNum:
        f1 =  mid +1
    elif mid==myNum:
        print("走了", step)
        break
    else:
        print("error!")
        break

